package com.example.service;

import com.example.mapper.TicketMapper;
import com.example.pojo.Ticket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class ThreadService {
    @Autowired
    private TicketMapper ticketMapper;
    @Async("taskExecutor")
    public void insertOrder(long id) {
        ticketMapper.insertOrder(id);
//        try {
//            Thread.sleep(3000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
    }
}
